package com.blacktea.behavioralpatterns.chainofresponsibilitypattern.handler;

import javax.servlet.http.HttpServletRequest;

/**
 * @description: 请求日志节点类
 * @author: black tea
 * @date: 2023/3/24 16:12
 */
public abstract class RequestLogger {

    protected RequestLogger nextHandler;

    public void setNextHandler(RequestLogger nextHandler) {
        this.nextHandler = nextHandler;
    }

    /**
     * 执行任务
     * @param request 请求对象
     */
    public abstract void handler(HttpServletRequest request);

    /**
     * 执照该顺序执行，越小执行越早
     * @return int
     */
    public abstract int order();
}
